package collection;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Random;
public class CollectionDemo {
    public static void main(String[] args) {
        ArrayList c = new ArrayList();
        c.add("aaa");
        c.add(123);
        c.add(1,"111");
//        System.out.println(c.toString());
//        int len = c.size();
//        System.out.println(len);
//
//        boolean res = c.isEmpty();
//        System.out.println(res);
//
//        c.clear();
//        System.out.println(c);


        Collection c1 = new ArrayList();
        c1.add(new Point(3,5));
        c1.add(new Point(3,4));
        c1.add(new Point(3,3));
        c1.add(new Point(3,2));
        c1.add(new Point(3,5));
        System.out.println(c1.toString());
        System.out.println(c1.size());

        Point p = new Point(3,5);
        System.out.println(c1.contains(p));
        c1.remove(p);
//        System.out.println(c1);
//        c1.remove(p);
//        System.out.println(c1);

        c.addAll(c1);
        System.out.println(c);
        System.out.println(c1);

        System.out.println(c.containsAll(c1));

        c.retainAll(c1);
//        System.out.println(c);
//        System.out.println(c1);


    }
}
